// 用户

import type R from '@/types/conduit/R'
import type { WeixinLoginParam } from '@/types/param/user'
import type { AssetsStatisticsVO } from '@/types/response/coupon'
import type { AuthenticationTokens, UserInfo } from '@/types/response/user'
import request from '@/utils/request'
export const loginForWeixin = (weixinLoginParam: WeixinLoginParam): Promise<R<AuthenticationTokens>> =>
  request({
    url: `/user/user/loginForWeixin`,
    method: 'POST',
    data: weixinLoginParam
  })
export const refreshToken = (refreshToken: string): Promise<R<AuthenticationTokens>> =>
  request({
    url: `/user/user/refreshToken`,
    method: 'GET',
    params: { refreshToken }
  })
export const getUserInfo = (): Promise<R<UserInfo>> =>
  request({
    url: `/user/user/getUserInfo`,
    method: 'GET'
  })
export const assetsStatistics = (): Promise<R<AssetsStatisticsVO>> =>
  request({
    url: `/user/user/assets-statistics`,
    method: 'GET'
  })
